import Footer from "@/components/footer";
import Header from "@/components/header";
import axios from "axios";
import css from "./index.module.scss";
import logoImg from "@/assets/logo.png";
import bgImg from "@/assets/1.jpg";
const Home = (props: any) => {
  const { data } = props;
  const renderStr = (str: string) => {
    if (!str)
      return "昔陈胜，吴广于大泽乡高呼，王侯将相宁有种乎？及后秦灭汉兴，可见人无天生贵胄贫贱之分，盖追求也！<br>吾幼时贫困，生于乡野，里有夙愿，看尽繁华，奈何先天不足，穷且益坚，唯勤学不缀，方有所成！<br>时做诗约：<br>愿化鲲鱼，<br>浮游海底，<br>一日振翅，<br>鹏程万里。";
    return str.replace(/\\n/g, "<br />");
  };
  return (
    <div className={css.home}>
      <Header isShowLogo={false} />
      <div className={css.content}>
        <div className={css.con}>
          <div className={css.logo}>
            <img src={logoImg.src} alt="" />
          </div>
          <div
            className={css.text}
            dangerouslySetInnerHTML={{ __html: renderStr(data?.abstract) }}
          />
          <Footer />
        </div>
        <div className={css.r_bg}>
          <img src={bgImg.src} alt="" />
        </div>
      </div>
    </div>
  );
};
// Home.getInitialProps = async () => {
//   const result = await axios.get("/api/home/find");
//   return {
//     data: result.data.data,
//   };
// };
export default Home;
